#!/bin/bash

# This subscript allows to install a minimal mandriva distribution into the 
# newly created partition from mbootstrap.
# or simply give the destination partition or directory as first argument.

echo "Installing the distribution..."
urpmi --auto --no-suggests --excludedocs --root $1 binutils perl urpmi kernel-desktop586-latest basesystem initscripts dhcp-client

echo "Copying grub menu.lst"
cp /usr/share/mboostrap/grub/menu.lst.mdv $1/boot/grub/menu.lst

echo "Configuring network device"
echo "DEVICE=eth0" > $1/etc/sysconfig/network-scripts/ifcfg-eth0
echo "BOOTPROTO=dhcp" >> $1/etc/sysconfig/network-scripts/ifcfg-eth0
echo "METRIC=10" >> $1/etc/sysconfig/network-scripts/ifcfg-eth0

echo "Configuring network to get up on boot"
echo "NETWORKING=yes" > $1/etc/sysconfig/network

echo "Done."

exit 0
